package org.gdgbologna.resources;

import java.io.Serializable;
import java.util.ArrayList;

import android.os.Parcel;
import android.os.Parcelable;

public class Devfest implements Parcelable {

	public String title;
	public ArrayList<Session> session;

	public Devfest(){
		session = new ArrayList<Session>();
	}

	public Devfest(String t){
		this.title = t;
		session = new ArrayList<Session>();
	}

	public Devfest (Parcel in) {
		this();
		readFromParcel(in);
	}

	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public ArrayList<Session> getSessions() {
		return session;
	}

	public void addSession(Session toAdd){
		session.add(toAdd);
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(title);
		dest.writeTypedList(session);
	}

	private void readFromParcel(Parcel in) {
		this.title = in.readString();
		in.readTypedList(session, Session.CREATOR);
	}

	public static final Parcelable.Creator<Devfest> CREATOR = new Parcelable.Creator<Devfest>() {

		public Devfest createFromParcel(Parcel source) {
			return new Devfest(source);
		}

		@Override
		public Devfest[] newArray(int size) {
			// TODO Auto-generated method stub
			return new Devfest[size];
		}

	};

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

}
